package Lecel03;

import java.util.Scanner;

public class Three {
    public static void main(String[] args) {
        System.out.println("请输入手机号");
        String nextLine = new Scanner(System.in).next();
        boolean matches = nextLine.matches("[0-9]{11}");
        if (matches) {
            char a = nextLine.charAt(8);
            char b = nextLine.charAt(9);
            char c = nextLine.charAt(10);
            if (a == b && b == c) {
                System.out.println("手机是靓号");
            }else {
                System.out.println("手机正确，但不是靓号");
            }
        } else {
            System.out.println("手机错误，格式为11个数字");
        }

    }
}
